using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public partial class VolumPage : FuncPage
{
    protected override void Init()
    {
        base.Init();

        m_VolumBlankSlider.value = AudioManager.Instance.GetVolum(ClipKind.BackgoundMusic);
        m_VolumTextTextMeshProUGUI.SetText((m_VolumBlankSlider.value * 100).ToString("000"));
    }
    protected override void AddInputEventCallback()
    {
        base.AddInputEventCallback();

        m_VolumBlankSlider.onValueChanged.AddListener((value) =>
        {
            AudioManager.Instance.SetVolum(ClipKind.BackgoundMusic, value);
            m_VolumTextTextMeshProUGUI.SetText((value * 100).ToString("000"));
        });
    }
    protected override void RemoveInputEventCallback()
    {
        base.RemoveInputEventCallback();

        m_VolumBlankSlider.onValueChanged.RemoveAllListeners();
    }
}
